package com.nhim.cms.jaxws;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebService;
import com.nhim.cms.CustomWidgetProperty;
import com.nhim.cms.INhimWidget;
import com.nhim.core.ReflectionHelper;

@WebService(endpointInterface ="com.nhim.cms.jaxws.CustomWidgetPropertyWS")
public class CustomWidgetServiceEndpoint implements CustomWidgetPropertyWS {
	
	
	
	@WebMethod
	public List<CustomWidgetProperty> getProperties( String className)
	{
		List<CustomWidgetProperty> result = new ArrayList<CustomWidgetProperty>();
		INhimWidget widg;
		try {
			widg = (INhimWidget) ReflectionHelper.createInstanceFrom(className, "contructorParamValue");
			result.addAll(widg.getAllProperties());
		} catch (SecurityException e) {
			
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			
			e.printStackTrace();
		} catch (InstantiationException e) {
			
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			
			e.printStackTrace();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
	return result;
	}

}
